#include "mystdio.h"
#include <unistd.h>

#define filename "test.txt"

int main()
{
    _FILE* fp = _fopen(filename, "a");
    if(fp == NULL) return 1;

    char* msg = "hello linux!\n";
    int cnt = 5;
    while(cnt)
    {
        _fwrite(fp, msg, strlen(msg));
        cnt--;
        sleep(1);
    }

    _fclose(fp);

    return 0;
}
